<template>
  <h2 class="enter-x mb-3 text-center text-2xl font-bold xl:text-center xl:text-3xl">
    {{ getFormTitle }}
  </h2>
</template>

<script setup lang="ts">
import { LoginStateEnum, useLoginState } from './useLogin'

defineOptions({ name: 'LoginFormTitle' })

const { t } = useI18n()

const { getLoginState } = useLoginState()

const titleObj = {
  [LoginStateEnum.PASSWD_LOGIN]: t('sys.login.signInFormTitle'),
  [LoginStateEnum.SMS_CODE_LOGIN]: t('sys.login.mobileSignInFormTitle'),
  [LoginStateEnum.RESET_PASSWD]: t('sys.login.forgetFormTitle')
}

const getFormTitle = computed(() => {
  return titleObj[unref(getLoginState)]
})
</script>

<style scoped lang="scss"></style>
